<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
    <style>
        * {
            padding: 0;
            margin: 0;

        }
        .box:active {
            transform: rotate3d(1,1,0,360deg)
        }
        .box {
            width: 200px;
            height: 200px;
            margin: 300px auto;
            position: relative;
            transform: rotate3d(1,1,0,40deg);
            transform-style: preserve-3d;
            perspective: 214px;
            perspective-origin: 10px 10px;
            transition: transform 2s linear 0s;
        }
        .box > div {
            width: 200px;
            height: 200px;
            position: absolute;
        }
        .front {
            background: rgb(235, 75, 75);
            transform: translate3d(0px,0px,100px);
        }
        .back {
            background: rgb(47, 218, 138);
            transform: translate3d(0px,0px,-100px);
        }
        .left {
            background: rgb(20, 141, 221);
            transform: translate3d(-100px,0px,0px) rotate3d(0,1,0,90deg);

        }
        .right {
            background: rgb(206, 90, 200);
            transform: translate3d(100px,0px,0px) rotate3d(0,1,0,90deg);
        }
        .top {
            background: rgb(199, 65, 121);
            transform: translate3d(0px,-100px,0px) rotate3d(1,0,0,90deg);
        }
        .bottom {
            background: rgb(30, 218, 192);
            transform: translate3d(0px,100px,0px) rotate3d(1,0,0,90deg);
        }
    </style>
<body>
   <div class="box">
       <div class="front">
        front
       </div>
       <div class="back">
        back
       </div>
       <div class="left">
        left
       </div>
       <div class="right">
        right
       </div>
       <div class="top">
        top
       </div>
       <div class="bottom">
        bottom
       </div>
   </div>
</body>
</html>